﻿using HS.Business.Security;
using HS.Domain.EF;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace HS.Presentation.Web.Controllers
{
    public class EstadoGeneralController : Controller
    {
        [HttpPost]
        public ActionResult GetEntities(bool? rowStatus)
        {
            EstadoGeneralBusiness obj = new EstadoGeneralBusiness();
            var objList = obj.GetEntities(rowStatus);

            var model = JsonConvert.SerializeObject(objList, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore });
            var list = Json(JsonConvert.DeserializeObject(model, typeof(List<EstadoGeneral>)));

            return list;
        }
    }
}
